package cn.labbook.bluetooth.entity.excel;

import cn.labbook.bluetooth.entity.TenantAmmeterPayView;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.experimental.Accessors;

import java.text.SimpleDateFormat;
import java.util.Date;

@Data
@Accessors(chain = true)
public class TenantPayTemplate {
    private String ammeterId;
    private String location;
    private String payTime;
    private Double payAmouont;
    private Double managerAmount;
    private Double payTrueAmouont;
    private Double wxPlatformAmount;
    private Double zkisPlatformAmount;
    public static TenantPayTemplate build(TenantAmmeterPayView tenantAmmeterPayView) {
        TenantPayTemplate tenantPayTemplate = new TenantPayTemplate();
        tenantPayTemplate.setAmmeterId(tenantAmmeterPayView.getAmmeterId());
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        tenantPayTemplate.setPayTime(sdf.format(tenantAmmeterPayView.getPayTime()));
        tenantPayTemplate.setPayAmouont(tenantAmmeterPayView.getPayAmouont());
        tenantPayTemplate.setManagerAmount(tenantAmmeterPayView.getManagerAmount());
        tenantPayTemplate.setPayTrueAmouont(tenantAmmeterPayView.getPayTrueAmouont());
        tenantPayTemplate.setWxPlatformAmount(tenantAmmeterPayView.getWxPlatformAmount());
        tenantPayTemplate.setZkisPlatformAmount(tenantAmmeterPayView.getZkisPlatformAmount());
        tenantPayTemplate.setLocation(tenantAmmeterPayView.getLocation());
        return tenantPayTemplate;
    }
}
